import { useDict } from '@/utils/dict/useDict'
let project_level = useDict('project_level')
let project_type = useDict('project_type')
let project_result_type = useDict('project_result_type')
let paper_result_type = useDict('paper_result_type')
let competition_type = useDict('competition_type')
let funding_type = useDict('funding_type')
let course_level = useDict('course_level')
let course_result_type = useDict('course_result_type')
let research_type = useDict('research_type')
let award_level = useDict('award_level')
export const searchList = [
  {
    type: 'select',
    name: '教研类型 ',
    field: 'researchTypeId',
    selectList: research_type
  }
]

export const listColumns = [
  [
    {
      title: '项目名称',
      key: 'researchName',
    },
    {
      title: '项目级别',
      key: 'projectLevelName',
    },
    {
      title: '项目类型',
      key: 'projectTypeName',
    },
    {
      title: '项目状态',
      key: 'researchStatusName',
    },
    {
      title: '所属学院',
      key: 'collageName',
    },
    {
      title: '经费总额(万元)',
      key: 'outlay',
    },
    {
      title: '最近更新时间',
      key: 'updateTime',
    },
  ],
  [
    {
      title: '论文标题',
      key: 'researchName',
    },
    {
      title: '作者',
      key: 'members',
    },
    {
      title: '研究主题',
      key: 'researchTopic',
    },
    {
      title: '成果类型',
      key: 'paperResultTypeName',
    },
    {
      title: '审核状态',
      key: 'researchStatus',
    },
    {
      title: '发表年份',
      key: 'publishYear',
    },
    {
      title: '最近更新时间',
      key: 'updateTime',
    },
  ],
  [
    {
      title: '赛事名称',
      key: 'researchName',
    },
    {
      title: '主办单位',
      key: 'organizer',
    },
    {
      title: '赛事类型',
      key: 'competitionTypeName',
    },
    {
      title: '赛事状态',
      key: 'researchStatusName',
    },
    {
      title: '参赛人',
      key: 'members',
    },
    {
      title: '作品名称',
      key: 'researchName',
    },
    {
      title: '最近更新时间',
      key: 'updateTime',
    },
  ],
  [
    {
      title: '课题名称',
      key: 'researchName',
    },
    {
      title: '课题级别',
      key: 'courseLevelName',
    },
    {
      title: '学科领域',
      key: 'disciplineField',
    },
    {
      title: '当前状态',
      key: 'researchStatusName',
    },
    {
      title: '所属部门',
      key: 'collageName',
    },
    {
      title: '经费总额(万元)',
      key: 'outlay',
    },
    {
      title: '最近更新时间',
      key: 'updateTime',
    }
  ]
]

export const actionArr = [
  {
    action: 'look',
    value: '查看',
  },
  {
    action: 'edit',
    value: '编辑',
  },
  {
    action:'process',
    value: '办理',
    hiddenList: [
			{
				fileId: 'researchStatusId',
				showTerm: ['96','97','98','100','101','103','104','106','107','108','109'],
			},
		]
  },
  {
    action: 'del',
    value: '删除',
  }
]
export const btnList = [
  {
    action: 'add',
    value: '新增',
    auth: ''
  }
];

export const fields = {
  [83]:[
    {
      type: 'input',
      label:'项目名称',
      prop:'researchName',
      required:true
    },
    {
      type: 'select',
      label:'项目级别',
      prop:'projectLevelId',
      selectList: project_level,
      required:true
    },
    {
      type: 'select',
      label:'项目类型',
      prop:'projectTypeId',
      selectList: project_type,
      required:true
    },
    {
      type: 'tree',
      label:'所属学院',
      prop:'collageId',
      value: 39,
    },
    {
      type: 'tree',
      label:'所属专业',
      prop:'majorId',
      value: 40,
    },
    {
      type: 'number',
      label:'经费总额(万元)',
      prop:'outlay',
      required:true
    },
    {
      type: 'input',
      label:'依托课程',
      prop:'course'
    },
    {
      type: 'select',
      label:'项目成果形式',
      prop:'projectResultTypeId',
      selectList: project_result_type,
      required:true
    },
    {
      type: 'textarea',
      label:'项目成员',
      prop:'members',
      required:true
    },
    {
      type: 'date',
      label:'开课时间',
      prop:'startDate',
      required:true
    },
    {
      type: 'date',
      label:'结课时间',
      prop:'endDate',
      required:true
    },
    {
      type:"file",
      label:'成果',
      prop:'resultFileId',
      required:true
    },
    {
      label:'简历',
      prop:'resumeFileId',
      type:"file",
      required:true
    },
  ],
  [84]:[
    {
      type: 'input',
      label: '论文标题',
      prop: 'researchName',
      required:true
    },
    {
      type: 'input',
      label: '作者',
      prop:'members',
      required:true
    },
    {
      type: 'date',
      label: '发表年份',
      prop: 'publishYear',
      required:true
    },
    {
      type: 'input',
      label: '研究主题',
      prop: 'researchTopic',
      required:true
    },
    {
      type: 'select',
      label: '成果类型',
      prop: 'paperResultTypeId',
      selectList: paper_result_type,
      required:true
    },
    {
      type: 'file',
      label: '关联资源',
      prop: 'resultFileId',
      required:true
    },
  ],
  [85] :[
    {
      type: 'input',
      label: '赛事名称',
      prop: 'competitionName',
      required:true
    },
    {
      type: 'input',
      label: '主办单位',
      prop: 'organizer',
      required:true
    },
    {
      type: "select",
      label: '赛事类型',
      prop: 'competitionTypeId',
      selectList: competition_type,
      required:true
    },
    {
      type: 'input',
      label: '参赛人',
      prop: 'members',
      required:true
    },
    {
      type: 'input',
      label: '作品名称',
      prop: 'researchName',
      required:true
    },
    {
      type: 'select',
      label: '获奖等级',
      prop: 'awardLevel',
      selectList: award_level,
      required:true
    },
    {
      type: 'date',
      label:'开始时间',
      prop:'startDate',
      required:true
    },
    {
      type: 'date',
      label:'结束时间',
      prop:'endDate',
      required:true
    },
    {
      type:'file',
      label:'成果',
      prop:'resultFileId',
      required:true
    }
  ],
  [86] :[
    {
      type: 'input',
      label: '课题名称',
      prop: 'researchName',
      required:true
    },
    {
      type: 'select',
      label: '课题级别',
      prop: 'courseLevelId',
      selectList: course_level,
      required:true
    },
    {
      type: 'input',
      label: '学科领域',
      prop: 'disciplineField',
      required:true
    },
    {
      type: 'select',
      label: '经费类型',
      prop: 'fundingTypeId',
      selectList: funding_type
    },
    {
      type: 'tree',
      label: '所属部门',
      prop: 'collageId',
      value: 42,
      required:true
    },
    {
      type: 'input',
      label: '经费总额(万元)',
      prop: 'outlay',
      required:true
    },
    {
      type: 'input',
      label: '参与人员',
      prop: 'members',
    },
    {
      type: 'select',
      label: '成果形式',
      prop: 'courseResultTypeId',
      selectList: course_result_type,
      required:true
    },
    {
      type: 'input',
      label: '获奖情况',
      prop: 'awardStatus',
    },
    {
      type: 'date',
      label: '开课时间',
      prop: 'startDate',
      required:true
    },
    {
      type: 'date',
      label: '结课时间',
      prop: 'endDate',
      required:true
    },
  ]
}

export const rules = {
  [83]:{
    researchName: [
      { required: true, message: '请输入项目名称', trigger: 'change' },
      { pattern: /^(?!^\d+$).+$/, message: '不能为纯数字', trigger: 'blur'}
    ],
    projectLevelId: [
      { required: true, message: '请选择项目级别', trigger: 'change' },
    ],
    researchTypeId: [
      { required: true, message: '请选择项目类型', trigger: 'change' },
    ],
    outlay: [
      { required: true, message: '请输入经费总额', trigger: 'change' },
    ],
    projectResultTypeId: [
      { required: true, message: '请选择项目成果形式', trigger: 'change' },
    ],
    members: [
      { required: true, message: '请输入项目成员', trigger: 'change' },
    ],
    startDate: [
      { required: true, message: '请选择开课时间', trigger: 'change' },
    ],
    endDate: [
      { required: true, message: '请选择结课时间', trigger: 'change' },
    ],
    resultFileId: [
      { required: true, message: '请上传成果文件', trigger: 'change' },
    ],
    resumeFileId: [
      { required: true, message: '请上传简历文件', trigger: 'change' },
    ],
  },
  [84]:{
    researchName: [
      { required: true, message: '请输入论文标题', trigger: 'change' },
      { pattern: /^(?!^\d+$).+$/, message: '不能为纯数字', trigger: 'blur'}
    ],
    members: [
      { required: true, message: '请输入作者', trigger: 'change' },
    ],
    publishYear: [
      { required: true, message: '请选择发表年份', trigger: 'change' },
    ],
    researchTopic: [
      { required: true, message: '请输入研究主题', trigger: 'change' },
    ],
    paperResultTypeId: [
      { required: true, message: '请选择成果类型', trigger: 'change' },
    ],
    resultFileId: [
      { required: true, message: '请上传关联资源', trigger: 'change' },
    ],
  },
  [85]:{
    competitionName: [
      { required: true, message: '请输入赛事名称', trigger: 'change' },
      { pattern: /^(?!^\d+$).+$/, message: '不能为纯数字', trigger: 'blur'}
    ],
    organizer: [
      { required: true, message: '请输入主办单位', trigger: 'change' },
    ],
    competitionTypeId: [
      { required: true, message: '请选择赛事类型', trigger: 'change' },
    ],
    members: [
      { required: true, message: '请输入参赛人', trigger: 'change' },
    ],
    researchName: [
      { required: true, message: '请输入作品名称', trigger: 'change' },
    ],
    awardLevel: [
      { required: true, message: '请选择获奖等级', trigger: 'change' },
    ],
    startDate: [
      { required: true, message: '请选择开始时间', trigger: 'change' },
    ],
    endDate: [
      { required: true, message: '请选择结束时间', trigger: 'change' },
    ],
    resultFileId: [
      { required: true, message: '请上传成果', trigger: 'change' },
    ],
  },
  [86]:{
    researchName: [
      { required: true, message: '请输入课题名称', trigger: 'change' },
      { pattern: /^(?!^\d+$).+$/, message: '不能为纯数字', trigger: 'blur'}
    ],
    courseLevelId: [
      { required: true, message: '请选择课题级别', trigger: 'change' },
    ],
    disciplineField: [
      { required: true, message: '请输入学科领域', trigger: 'change' },
    ],
    collageId: [
      { required: true, message: '请选择所属部门', trigger: 'change' },
    ],
    outlay: [
      { required: true, message: '请输入经费总额', trigger: 'change' },
    ],
    courseResultTypeId: [
      { required: true, message: '请选择成果形式', trigger: 'change' },
    ],
    startDate: [
      { required: true, message: '请选择开课时间', trigger: 'change' },
    ],
    endDate: [
      { required: true, message: '请选择结课时间', trigger: 'change' },
    ],
  }
}